Skip to content

Conversation

@benlubas
Copy link

@benlubas benlubas commented Jan 22, 2026

weird company behavior

Welcome to the quarto GitHub repo!

We are always happy to hear feedback from our users.

To file a pull request, please follow these instructions carefully: https://yihui.org/issue/#bug-reports

If you're a collaborator from outside quarto-dev making changes larger than a typo, please make sure you have filed an individual or corporate contributor agreement. You can send the signed copy to jj@rstudio.com.

Description

Adding support for the q/kdb programming language in two ways:

  • adding the comment string (/)
  • allowing quarto to read percent format notebooks that have comment strings other than the previously hard coded #, and of course adding support for q

Addresses #12168
Part of #13946

Checklist

I have (if applicable):

  • filed a contributor agreement.
  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR

I'm a new contributor, please point me in the direction of any tests you need me to add/documentation you need me to write.

Additionally, make it possible for quarto to read percent style
notebooks from languages that don't use `#` as the comment char
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jan 22, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@benlubas benlubas changed the title feat: add q comment string feat: support for q/kdb programming language Jan 23, 2026
@benlubas
Copy link
Author

benlubas commented Jan 23, 2026

I've also been able to add q syntax highlighting by adding these two files to /src/resources/pandoc/syntax-definitions/. It looks like you're already storing some Kate syntax files there, so could we add these two as well?

I'm not sure that jives with the agreement that you made me sign in order to contribute, but you're already doing it, so it seems okay?

@cscheid
Copy link
Collaborator

cscheid commented Jan 27, 2026

Thanks for the PR!

I'm not sure that jives with the agreement that you made me sign in order to contribute, but you're already doing it, so it seems okay?

I think the CLA we have covers that, yes.

I'll send a review along. If you were only adding the extensions to the list as well as the Kate files, I'd be willing to merge it without tests. But you've added a new feature (which is great!), and so that means we need to make sure we're not breaking anything now or in the future.

One added complication is that I'm not sure that I want to have our CI install the q/kdb jupyter kernel. I have to think about this a little bit.

Copy link
Collaborator

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's ok to change the comment syntax from jupyter percent scripts?

This appears to imply it's not: https://jupytext.readthedocs.io/en/latest/formats-scripts.html

@benlubas
Copy link
Author

Are you sure it's ok to change the comment syntax from jupyter percent scripts?

Yes, I think so. Jupytext supports other languages and other comment strings. here is the source code: https://github.com/mwouts/jupytext/blob/main/src%2Fjupytext%2Flanguages.py#L52

@cscheid
Copy link
Collaborator

cscheid commented Jan 27, 2026

I have a number of fixes/suggestions here that I'm going to push to this PR. Stand by for a couple of hours - thanks!

- Add comprehensive unit tests for percent format notebook parsing
- Test detection and conversion for Python, Julia, R, and q languages
- Fix isJupyterPercentScript regex: properly group alternation (markdown|raw)
  and use multiline mode so ^ matches start of any line
- Add changelog entries for q/kdb+ support and regex fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cscheid
Copy link
Collaborator

cscheid commented Jan 27, 2026

Ok, the fixes are there. Let's see what the CI says now.

@benlubas
Copy link
Author

You're too kind! I hope you don't feel the need to do this for all of my PRs, I don't want to create a ton of extra work 😅

@cscheid
Copy link
Collaborator

cscheid commented Jan 27, 2026

You're too kind! I hope you don't feel the need to do this for all of my PRs, I don't want to create a ton of extra work 😅

Thanks for the kind words. My answer would have been different 6 months ago, but now I have a hungry ghost on my side that likes to write TS code, it turns out! This looks good to me now, but I've been far from quarto-cli for the last couple of months, so I'll let someone else press the final merge button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants